import 'package:demo1/view/DistrictListPage.dart';
import 'package:flutter/material.dart';
import 'package:demo1/view//styleConstants.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:demo1/util/GraphqlUtil.dart';

void main() {

  // runApp(MaterialApp(home: RadialAnimationDemo(),));
  // runApp(MaterialApp(home: ListPage(),));
  runApp(MyAppDemo());
}

class MyAppDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GraphQLProvider(
      child: MaterialApp(
        theme: ThemeData(
          chipTheme: Theme.of(context).chipTheme.copyWith(
                backgroundColor: StyleConstants.Green100,
                labelStyle: Theme.of(context).textTheme.bodyText2,
              ),
          dividerTheme: DividerThemeData(thickness: 2),
          primaryColor: StyleConstants.PrimaryGreen800,
          accentColor: StyleConstants.SecondaryOrange800,
          cardTheme: CardTheme(
            margin: EdgeInsets.all(10),
            shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(10),
                side: BorderSide(color: Theme.of(context).dividerColor)),
            elevation: 4,
          ),
          buttonTheme: Theme.of(context).buttonTheme.copyWith(
              highlightColor: StyleConstants.SecondaryOrange800,
              textTheme: ButtonTextTheme.primary,
              buttonColor: StyleConstants.SecondaryOrange800,
              colorScheme: Theme.of(context).colorScheme.copyWith(
                  primary: StyleConstants.White50,
                  secondary: StyleConstants.SecondaryOrange800)),
          // buttonBarTheme: base.buttonBarTheme
          //     .copyWith(buttonTextTheme: ButtonTextTheme.normal),
          cardColor: StyleConstants.White50,
          scaffoldBackgroundColor: StyleConstants.White50,
          errorColor: StyleConstants.ErrorRed800,
          textTheme: Theme.of(context).textTheme.apply(
              fontFamily: 'SourceHan',
              bodyColor: StyleConstants.PrimaryGreen800,
              fontSizeFactor: 1.2,
              displayColor: StyleConstants.PrimaryGreen800),
          snackBarTheme: SnackBarThemeData(
              contentTextStyle: Theme.of(context).textTheme.subtitle1),
          // textTheme: Theme.of(context).textTheme.apply(
          //     fontFamily: 'SourceHan',
          //     bodyColor: White50,
          //     displayColor: Green500),
          // This is the theme of your application.

          secondaryHeaderColor: StyleConstants.SecondaryOrange800,
          // This makes the visual density adapt to the platform that you run
          // the app on. For desktop platforms, the controls will be smaller and
          // closer together (more dense) than on mobile platforms.
          visualDensity: VisualDensity.adaptivePlatformDensity,
        ),
        home: DistrictListPage(),
      ),
      client:clientNotifiler ,
    );
  }
}
